home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / pxewin.zip / BROWSEFM.HPP < prev    next >
C/C++ Source or Header  |  1992-02-27  |  4KB  |  148 lines

  1. // PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
  2.  
  3. // BROWSEFM.HPP //
  4.  
  5. // Contents ----------------------------------------------------------------
  6. //
  7. //     This module contains the MDI compatible BrowserFrame class.
  8. //
  9. // End ---------------------------------------------------------------------
  10.  
  11. // External Reference Name for this Header ---------------------------------
  12.  
  13. #ifndef BROWSEFM_HPP
  14.     #define BROWSEFM_HPP
  15.  
  16. // End ---------------------------------------------------------------------
  17.  
  18. // Interface Dependencies --------------------------------------------------
  19.  
  20. #ifndef PXSCROLL_CPP
  21.     #include "pxscroll.cpp"
  22. #endif // PXSCROLL_CPP //
  23.  
  24. #ifndef PXI_HPP
  25.     #include "pxi.hpp"
  26. #endif // PXI_HPP //
  27.  
  28. #ifndef DBDISPLY_CPP
  29.     #include "dbdisply.cpp"
  30. #endif // DBDIPSLY_CPP //
  31.  
  32. #ifndef BROWSE_CPP
  33.     #include "browse.cpp"
  34. #endif // BROWSE_CPP //
  35.  
  36. // End ---------------------------------------------------------------------
  37.  
  38. // class BrowserFrame //
  39.  
  40. _CLASSDEF(BrowserFrame)
  41. class BrowserFrame:public TMDIFrame
  42. {
  43. private:
  44.     PPXI engine;                /* Pointer to engine
  45.                            initialization object */
  46.     int error;                /* error flag */
  47.     PWNDCLASS MyClass;            /* Windows class */
  48.     PBrowser NewChild;            /* New child pointer */
  49.     virtual const Pchar streamableName()
  50.     const                    /* Defines the streamable
  51.                            name for this class. */
  52.     {
  53.         return "BrowserFrame";
  54.     }
  55. protected:
  56.     virtual Pvoid read(Ripstream);        /* Read persistant object */
  57.     virtual void write(Ropstream);        /* Write persistant object */
  58.     virtual void ReadChildren(Ripstream);    /* Read children from desk
  59.                            top file */
  60.     virtual void WriteChildren(Ropstream);    /* Write children to desk
  61.                            top file */
  62.     BrowserFrame(StreamableInit):        /* Persistant object
  63.                            constructor */
  64.         TMDIFrame(streamableInit)
  65.     {
  66.  
  67.     }
  68. public:
  69.     BrowserFrame(LPSTR ATitle);
  70.     static PTStreamable build();        /* Build persistant object */
  71.                         /* Create a child window */
  72.     virtual PTWindowsObject CreateChild();
  73.     ~BrowserFrame();            /* Close down all your
  74.                            children */
  75.                         /* Set up frame to so that
  76.                            you can have child
  77.                            windows */
  78.     void SetupWindow();
  79.                         /* If a file open command is
  80.                            recieved, open a new
  81.                            browser window */
  82.     virtual void CreateBrowser(RTMessage Msg) =
  83.         [CM_FIRST + CM_FILEOPEN];
  84.                         /* Opens a desktop file as
  85.                            a persistant object
  86.                            interface. */
  87.     virtual void OpenDeskTop(RTMessage Msg) =
  88.         [CM_FIRST + CM_OPENED];
  89.                         /* Save the current desktop
  90.                            as a persistant object. */
  91.     virtual void SaveDeskTop(RTMessage Msg) =
  92.         [CM_FIRST + CM_SAVEDT];
  93.                         /* Count the number of child
  94.                            windows. */
  95.     int GetChildCount();
  96.     void MenuItemDisable(int item);        /* Disable a menu item */
  97.     void MenuItemEnable(int item);        /* Enable a menu item */
  98.                         /* Check your children.  This
  99.                            message is sent by the
  100.                            browser frame that is in
  101.                            the process of destroying
  102.                            itself. */
  103.     virtual void CheckChildren(RTMessage Msg) =
  104.         [WM_CHKCHILD];
  105.     virtual void GetWindowClass(WNDCLASS& AWndClass);
  106.                         /* Set the mouse cursor to
  107.                            hour glass type */
  108.     virtual void CursorWait(RTMessage Msg) =
  109.         [WM_SETWTCUR];
  110.                         /* Set the mouse cursor to
  111.                            normal type */
  112.     virtual void CursorNormal(RTMessage Msg) =
  113.         [WM_SETNMCUR];
  114.                         /* Show error message and
  115.                            kill associated window.
  116.                            Anytime you get ANY error
  117.                            from the PDOX engine
  118.                            except an engine
  119.                            intialization, it is
  120.                            dispatched here.
  121.                         */
  122.     virtual void PXError(RTMessage Msg) =
  123.         [WM_PXERROR];
  124. };
  125.  
  126. // Description -------------------------------------------------------------
  127. //
  128. //    This class allows construction of the MDI frame which will hold all
  129. //    the child windows.
  130. //
  131. // End ---------------------------------------------------------------------
  132.  
  133. // Define inserters and extractors for persistant objects:
  134.  
  135. inline Ripstream operator >> (Ripstream is,RBrowserFrame cl)
  136.     {return is >> (RTStreamable)cl;}
  137.  
  138. inline Ripstream operator >> (Ripstream is,RPBrowserFrame cl)
  139.     {return is >> (RPvoid)cl;}
  140.  
  141. inline Ropstream operator << (Ropstream os,RBrowserFrame cl)
  142.     {return os << (RTStreamable)cl;}
  143.  
  144. inline Ropstream operator << (Ropstream os,PBrowserFrame cl)
  145.     {return os << (PTStreamable)cl;}
  146.  
  147. #endif // BROWSEFM_HPP //
  148.